package com.tuanzi.loan.web.bean.banana;

import com.tuanzi.loan.business.service.banana.LoanBananaBindCardActionService;
import com.tuanzi.loan.core.aspect.Debug;
import com.tuanzi.loan.vo.request.banana.LoanBananaBindCardActionRequest;
import com.tuanzi.loan.vo.response.banana.LoanBananaBindCardActionResponse;
import com.tuanzi.loan.web.configuration.JSFListingSessionBean;
import com.tuanzi.loan.web.lazy.banana.LoanBananaBindCardActionLazyDataModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.faces.bean.ViewScoped;

/**
 * @author administrator
 * @createTime 2019-06-13 20:03
 */
@Data
@Debug
@Component
@ViewScoped
@EqualsAndHashCode(callSuper = true)
public class LoanBananaBindCardActionListBean extends JSFListingSessionBean<LoanBananaBindCardActionRequest,LoanBananaBindCardActionResponse> {

    @Autowired
    private LoanBananaBindCardActionService loanBananaBindCardActionService;

    @Override
    protected String page() {
        return "/views/family/credithousekeeper/compensation/compensation-company-list.xhtml";
    }

    @Override
    protected void initLazyDataModel() {
        $ = new LoanBananaBindCardActionRequest();
        lazyDataModel = new LoanBananaBindCardActionLazyDataModel($, session, loanBananaBindCardActionService);
    }

    public void onReset() throws Exception{
        initLazyDataModel();
    }

    public String onAdd(){
        return redirect("/views/banana/banana-bind-card-action-info.xhtml");
    }

    public String onSee(Long id){
        return redirect("/views/banana/banana-bind-card-action-info.xhtml?id="+id);
    }
}
